<h1>{{title}}</h1>

<div *ngIf="selectedHero" >
    <h2>{{selectedHero.name}}详情</h2>
    <div><label>id:</label>{{selectedHero.id}}</div>
    <div>
        <label>姓名:</label>
            <input  type="text" required  [(ngModel)]="selectedHero.name">
    </div>
</div>
<ul>
    <li *ngFor="let hero of heroes" (click)="onSelect(hero)">
        {{hero.name}}
    </li>
</ul>